package com.tapstitch.scm.common.enums;

/**
 * 物流类型, 对应数据库表: craft_db.shipping_type
 */
public enum ShippingSpeedTypeEnum {

    DHL_EXPRESS(2L, "International Express", "快速", 40), // 快速
    EXPRESS(1L, "Special Line", "中速", 20), // 中速
    STANDARD(3L, "Standard Shipping", "慢速", 10), // 慢速
    DOMESTIC_GROUND_SHIPPING(4L, "Domestic Ground Shipping", "国内履单", 0), // 针对国外履单服务商
    SPECIAL_LINE_PRO(5L, "Special Line Pro", "中速Pro", 30), // 中速Pro

    ;

    private final Long value;
    private final String desc;
    private final String descCn;
    private final int speedSort;

    ShippingSpeedTypeEnum(Long value, String desc, String descCn, int speedSort) {
        this.value = value;
        this.desc = desc;
        this.descCn = descCn;
        this.speedSort = speedSort;
    }

    public static ShippingSpeedTypeEnum gerByValue(Long value) {
        for (ShippingSpeedTypeEnum iterator : ShippingSpeedTypeEnum.values()) {
            if (iterator.getValue().equals(value)) {
                return iterator;
            }
        }
        return null;
    }

    public Long getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public String getDescCn() {
        return descCn;
    }

    public int getSpeedSort() {
        return speedSort;
    }
}
